#include "junix.h"
#include <boost/function.hpp>

using namespace std;
void f(std::string& s)
{
	std::cout<<s<<std::endl;
}

struct F
:public unary_function<void, std::string>
{
	void operator() (std::string& s)
	{
		std::cout<<s<<std::endl;
	}
};

int main(int argc, char **argv)
{
	boost::function<void(std::string)>  fs;
	F ff;
	fs=f;
	fs("hello,world");
	fs=ff;
	fs("hello,world");

	vector<boost::function<void(std::string)> > vf(10);
	fill(vf.begin(), vf.end(), fs);
	for_each(vf.begin(), vf.end(),
			boost::lambda::bind(boost::lambda::_1, 
				std::string("hello,junix.")));

	return 0;
}
